Interest Calculator
08/08/24
Python
Generate account and interest data for a savings account
Submit projection parameters into a table/queue for the script to pick up and process. The queue is loaded through an API call. After the calculations are complete, the resulting data are posted to the projection data table where it can be analyzed and used in charts.
Form Input in Coda
The user can enter up to 8 different values as parameters for the interest calculation. Each projection should have a title to differentiate it from other projections and a total number of months to run the projection for. The number of contributors will be multiplied by the individual contribution amount each month and added to the current balance along with the interest. The monthly interest is calculated from the previous balance times one-twelfth the yearly interest rate. If the user wants to increase the contribution amount over time, the increase amount and months to increase fields can be used.
Queued Projections
Once a projection has been submitted through the form, it can be found and edited on the queued projections page until the script has been executed. If I want to rerun one, I can reflag it for the run queue. Previously generated projection data is deleted, recalculated, and loaded into Coda to prevent conflicts.
Projection Charts
After the script has been executed, the data can be displayed in charts. Here, I have the account balance graphed over time in addition to the contributions and interest gained. This is just one of may ways this data could be displayed in Coda.
Result Comparison vs Online
I compared my results to an online calculator at investor.gov. I used an initial investment of $10,000 with a monthly contribution of $150. The annual interest rate was set to 5% and was compounded monthly for 5 years.
Result Comparison vs Excel
I ran another projection and compared it to some numbers calculated in Excel by a friend of mine who’s an accountant. This was set up for an initial investment of $5,000 and 3 contributors. The starting contribution rate was $150 per month. Every 12 months the contribution of each individual was raised $50. The annual interest rate was set to 5% and was compounded monthly for 10 years.